<?php
	function emailSend($email) {
		global $globalDebug;
		
		if ($globalDebug)
			print "Sending ".$email['id']."\n";
			
		if (mail($email['receiver'], $email['subject'], $email['message'], "From: ".$email['sender']."\n")) {
			if ($globalDebug)
				print "Sent email ".$email['id']."\n";
			databaseSetEmailSent($email);
		}else{
			if ($globalDebug)
				print "Faild sending email ".$email['id']."\n";
			print "*";
		}
	}
?>
